{{- $count := default 5 .Site.Params.featuredPostCount -}}
{{- if $count -}}
  {{- $featuredPosts := first $count (where (where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.featured" "eq" true) -}}
  {{- with $featuredPosts -}}
  <section class="featured-posts row card component">
    <div class="card-body">
      <h2 class="card-title">{{ T "featured_posts" }}</h2>
      <ul>
      {{- range . -}}
        <li><a href="{{ .Permalink }}">{{ partial "helpers/title" . }}</a></li>
      {{- end -}}
      </ul>
    </div>
  </section>
  {{- end -}}
{{- end -}}
